/*
Date:20210417 11:31pm
key:用例差点
*/
class Solution {
public:
    int F(vector<int>& nums, int &k)
    {
        int max=0;
        int big_k=k;
        int count;
        for(int j=0;j<nums.size();j++)
        {
            if(j==0){count=nums[j];}
            else{count=count xor nums[j];}
            
        }
        int count1;
        while(k>=0)
        {
            count1=count xor k;

            if(count1>max){max=count1;big_k=k;}
            k--;
        }
        return big_k;
    }
    vector<int> getMaximumXor(vector<int>& nums, int maximumBit)
    {
        int k;
        int n=nums.size();
        vector<int>v;
        while(n--)
        {
            //
            k=pow(2,maximumBit)-1;
            v.push_back(F(nums, k));
            nums.pop_back();
        }
        return v;
     }

    
};